package br.com.klis.easycontrast;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Dialogo de about utilizado por qualquer activity da aplicacao
 * @author Inacio
 *
 */
public class DialogAbout {
	public static Dialog create(Activity activity, Context mContext, String systemService){
		LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(systemService);
		View layout = inflater.inflate(R.layout.about_dialog,(ViewGroup) activity.findViewById(R.id.layout_root_dialog));

		((TextView)layout.findViewById(R.id.text)).setText(R.string.created_by_name);
		((TextView)layout.findViewById(R.id.email)).setText(R.string.created_by_email);
		((TextView)layout.findViewById(R.id.site)).setText("http://www.klis.com.br");
		AlertDialog.Builder alert = new AlertDialog.Builder(activity);
		alert.setIcon(android.R.drawable.ic_dialog_info);
		alert.setTitle(R.string.about_title);
		alert.setNeutralButton("OK", null);
		alert.setView(layout);
		return alert.create();
	}
}
